
#include "funcdef.h"


void Enable_Tasks(void);

void navcon_start(void)
{

	//Set up initial run-time clk parameters
	SCB.CLK_period = (unsigned long)CLK_getprd();
	SCB.CLK_pms = (unsigned long)CLK_countspms();

	//Set up task initial states
	Enable_Tasks();
	//Finish initialization*/
	SCB.INITIALISED = TRUE;
	//DEBUG
#ifdef _DEBUG
	LOG_printf(SCB.trace, "Debug Version");
	LOG_printf(SCB.trace, "CLK_period %d",SCB.CLK_period);
	LOG_printf(SCB.trace, "CLK_pms %d",SCB.CLK_pms);
#endif

}


void Enable_Tasks(void){

	SCB.TSK_ENA[TSK_BMA180] 	= 	TRUE;
	SCB.TSK_ENA[TSK_ITG3205] 	= 	TRUE;
	SCB.TSK_ENA[TSK_MS5611] 	= 	TRUE;
	SCB.TSK_ENA[TSK_HMC5883L] 	= 	TRUE;
	SCB.TSK_ENA[TSK_ctrl_term] 	= 	TRUE;
	SCB.TSK_ENA[TSK_datalog] 	= 	FALSE;
	SCB.TSK_ENA[TSK_GPS] 		= 	TRUE;
	SCB.TSK_ENA[MATRIX_TEST]	=   FALSE;
}
